#!/usr/bin/make -f

export DH_VERBOSE=1
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

libdir18 = $(shell ruby1.8 -r rbconfig -e 'print Config::CONFIG["rubylibdir"]')

clean::
	$(CURDIR)/build clean
	rm -rf $(DEB_DESTDIR)

build/ohcount::
	$(CURDIR)/build all

build/ohcount-doc::
	(cd doc && doxygen Doxyfile)

install/ohcount::
		mkdir -p debian/ohcount/usr/bin debian/ohcount/$(libdir18)/ohcount/
		cp bin/ohcount debian/ohcount/usr/bin/
		cp -R ruby/gestalt ruby/gestalt.rb ruby/ohcount.rb debian/ohcount/$(libdir18)/ohcount/


install/ohcount-doc::
		mkdir -p debian/ohcount-doc/usr/share/doc/ohcount-doc
		cp -aR doc/html/* debian/ohcount-doc/usr/share/doc/ohcount-doc
		cp -a README debian/ohcount-doc/usr/share/doc/ohcount-doc

get-orig-source:
	uscan --force-download
